package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.enums.IdType;

import java.beans.Transient;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 投票选项
 * </p>
 *
 * @author Five Team
 * @since 2018-05-24
 */
@Data
@Accessors(chain = true)
@TableName(value = "t_vote_option", resultMap = "BaseResultMap")
public class VoteOption extends Model<VoteOption> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 投票主体表ID
     */
    @NotNull(message = "投票不能为空")
    private Long voteId;
    /**
     * 已经选择次数
     */
    private Integer choiceTimes;
    /**
     * 选项名称
     */
    @NotBlank(message = "选项名称不能为空")
    @Length(min = 4, max = 20, message = "选项名称必须在4~20以内")
    private String name;
    private Long integralId;
    private BigDecimal payNumber;
    /**
     * 选项图标
     */
    private String icon;
    /**
     * 描述
     */
    private String description;
    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;
    private Date createDate;
    /**
     * 投票选项表
     */
    private Date updateDate;
    private String createBy;
    private Integer version;
    private Integer orders;
    private Integer joinCount;

    /**
     * 每个用户能投多少次此投票选项
     */
    private Integer canJoinTimes;

    private transient Vote vote;

    private transient Integral integral;

    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }


}

